// package com.example.mybatisplus.mapper;
//
// import com.baomidou.mybatisplus.core.mapper.BaseMapper;
// import com.baomidou.mybatisplus.core.metadata.IPage;
// import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
// import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
// import com.jec.realty.api.constant.RealtyConstants;
// import com.jec.realtymanagement.fee.model.request.FruitMarketStrataFeeDetailQuery;
// import com.jec.realtymanagement.meter.model.entity.FruitMarketElectricityMeter;
// import com.jec.realtymanagement.meter.model.entity.FruitMarketElectricityMeterBilling;
// import com.jec.realtymanagement.meter.model.request.FruitMarketMeterQuery;
// import com.jec.realtymanagement.meter.model.request.FruitMarketMeterReadQuery;
// import com.jec.realtymanagement.permission.RealtyDataPermission;
// import org.apache.ibatis.annotations.Mapper;
// import org.apache.ibatis.annotations.Param;
//
// import java.util.List;
// import java.util.Optional;
//
// @Mapper
// @RealtyDataPermission(tableName = "fm_electricity_meter", type = RealtyConstants.MAP_KEY_STALLS, field = "id" ,
//         association = true,associationSql = "(select meter_id from fm_electricity_meter_stall where stall_id in ({value}))")
// public interface FruitMarketElectricityMeterMapper extends BaseMapper<FruitMarketElectricityMeter> {
//
//     default IPage<FruitMarketElectricityMeter> page(FruitMarketMeterQuery query) {
//         IPage<FruitMarketElectricityMeter> page = Page.of(query.getPageNum(), query.getPageSize());
//         return new LambdaQueryChainWrapper<>(this)
//                 .like(query.getSn() != null, FruitMarketElectricityMeter::getSn, query.getSn())
//                 .like(query.getCode() != null, FruitMarketElectricityMeter::getCode, query.getCode())
//                 .in(query.getIds() != null, FruitMarketElectricityMeter::getId, query.getIds())
//                 .orderByAsc(FruitMarketElectricityMeter::getSort)
//                 .page(page);
//     }
//
//     default Optional<FruitMarketElectricityMeter> selectByCode(String code) {
//         return new LambdaQueryChainWrapper<>(this)
//                 .eq(FruitMarketElectricityMeter::getCode, code)
//                 .oneOpt();
//     }
//
//     List<FruitMarketElectricityMeter> listByContractCode(@Param("contractCode") String code);
//
//     /**
//      * 电表抄表单
//      * @param page 分页
//      * @param query 查询条件
//      * @return FruitMarketMeterReadResponse
//      */
//     IPage<FruitMarketElectricityMeter> readList(IPage<FruitMarketElectricityMeter> page, @Param("query") FruitMarketMeterReadQuery query);
//
//     /**
//      * 费用单明细列表
//      * @param page 分页信息
//      * @param query 查询条件
//      * @return FruitMarketElectricityMeterBilling
//      */
//     IPage<FruitMarketElectricityMeterBilling> pageList(IPage<FruitMarketElectricityMeterBilling> page, @Param("query") FruitMarketStrataFeeDetailQuery query);
// }
